<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="/view/conf/farmtag.tld" prefix="PF"%>
<!--课程表单-->
<div class="easyui-layout" data-options="fit:true">
	<div class="TableTitle" data-options="region:'north',border:false">
		WCP知识同步</div>
	<div data-options="region:'center'">
		同步状态：<span id="wcpsycnStateId"></span><span id="wcpsycnCnumId">0</span>/<span id="wcpsycnAllnumId">${num}</span>
	</div>
	<div data-options="region:'south',border:false">
		<div class="div_button" style="text-align: center; padding: 4px;">
			<a id="dom_do_WcpSycnClasst" href="javascript:void(0)"
				iconCls="icon-save" class="easyui-linkbutton">开始同步</a> <a
				id="dom_cancle_formClasstWcp" href="javascript:void(0)"
				iconCls="icon-cancel" class="easyui-linkbutton"
				style="color: #000000;">取消</a>
		</div>
	</div>
</div>
<script type="text/javascript">
	$(function() {
		$('#dom_cancle_formClasstWcp').bind('click', function() {
			$('#winClasstWcpSycn').window('close');
		});
		$('#dom_do_WcpSycnClasst').bind('click', function() {
			todoWcpSycn();
		});
		loadWcpSycnState();
	});
	function todoWcpSycn() {
		$.post('classt/sycnwcp.do', {
			'ids' : '${ids}'
		}, function(flag) {
			setTimeout(function() {
				loadWcpSycnState();
			}, 1000);
		}, 'json');
	}
	function loadWcpSycnState() {
		$.post('classt/sycnstate.do', {}, function(flag) {
			$('#wcpsycnStateId').text(flag.ISRUN);
			$('#wcpsycnCnumId').text(flag.CNUM);
			$('#wcpsycnAllnumId').text(flag.ALLNUM);
			setTimeout(function() {
				loadWcpSycnState();
			}, 1000);
		}, 'json');
	}
//-->
</script>